package com.neuedu.grainsapi.service.Impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.neuedu.grainsapi.mapper.NagrProdMapper;
import com.neuedu.grainsapi.pojo.NagrProd;
import com.neuedu.grainsapi.service.NagrProdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class NagrProdServiceImpl implements NagrProdService {
    @Autowired
    private NagrProdMapper nagrProdMapper;
    @Override
    public List<NagrProd> queryNagrProd() {
        PageHelper.startPage(1,30);
        List<NagrProd> nagrProds = nagrProdMapper.queryNagrProd();
        PageInfo<NagrProd> pageInfo = new PageInfo<>(nagrProds);
        return pageInfo.getList();
    }
}
